package com.glut.service.impl;

import com.github.pagehelper.Page;
import com.glut.mapper.SstsFeedbackMapper;
import com.glut.service.SstsFeedbackService;
import com.glut.vo.SstsFeedback;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author:沈林玉
 * @date:2020/2/13 10:56
 * @Description:
 */
@Service("sstsFeedbackService")
public class SstsFeedbackServiceImpl implements SstsFeedbackService {

    @Resource
    SstsFeedbackMapper sstsFeedbackMapper;

    /**
     * 1.查询未处理的反馈信息
     * @return
     */
    @Override
    public Page<SstsFeedback> selectAllNotFeedback(SstsFeedback sstsFeedback,
                                                   int pageNum,
                                                   int pageSize) {
        return sstsFeedbackMapper.selectAllNotFeedback(sstsFeedback,pageNum,pageSize);
    }

    /**
     * 1.1 通过用户id查询未处理反馈信息
     * @param sstsUserID
     * @return
     */
    @Override
    public Page<SstsFeedback> selectNotFeedbackByUserId(String sstsUserID,
                                                        int pageNum,
                                                        int pageSize) {
        return sstsFeedbackMapper.selectNotFeedbackByUserId(sstsUserID,pageNum,pageSize);
    }

    /**
     * 2.查询已经处理的反馈信息
     * @return
     */
    @Override
    public Page<SstsFeedback> selectAllDealFeedback(SstsFeedback sstsFeedback,
                                                    int pageNum,
                                                    int pageSize) {
        return sstsFeedbackMapper.selectAllDealFeedback(sstsFeedback,pageNum,pageSize);
    }


    /**
     * 2.1 通过用户id查询已处理反馈信息
     * @param sstsUserID
     * @return
     */
    @Override
    public Page<SstsFeedback> selectDealFeedbackByUserId(String sstsUserID,
                                                         int pageNum,
                                                         int pageSize) {
        return sstsFeedbackMapper.selectDealFeedbackByUserId(sstsUserID,pageNum,pageSize);
    }

    /**
     * 3.插入未处理的反馈信息
     * @param sstsFeedback
     * @return
     */
    @Override
    public int insertNotFeedback(SstsFeedback sstsFeedback) {
        return sstsFeedbackMapper.insertNotFeedback(sstsFeedback);
    }

    /**
     * 4.处理反馈信息
     * @param sstsFeedback
     * @return
     */
    @Override
    public int updateNotFeedback(SstsFeedback sstsFeedback) {
        return sstsFeedbackMapper.updateNotFeedback(sstsFeedback);
    }
}
